<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- //innerhtml只是里面的元素，outerihtml会包含父标签 -->
    <div id="app">
        <div class="houdunren" data="hd">houdunren.com</div>
        <div class="houdunwang">houdunwang.com</div>
      </div>
    <script>
  let app = document.querySelector('#app')
  console.log(app.outerHTML);

  app.outerHTML = '<h1>后盾人</h1>'

  //原来的数据被替换了，只能用outerhtml查询
  let div=document.querySelector("[data='hd']");
  console.log(div);//null

  //用+号可以保留原来的数据在html中的效果
//   app.outerHTML += '<h1>后盾人</h1>';
    </script>
</body>
</html>